// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_MST_PRODUCT
// * CreateDate    : 2014-06-05 18:30:16
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:16
// * LastChanger   : 2014-06-05 18:30:16
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class MstProductEntity : EntityBase
    {
        public MstProductTable TableSchema
        {
            get
            {
                return MstProductTable.Current;
            }
		}
		
		public MstProductEntity()
        {

        }
		
		public MstProductEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductTypeId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE_ID"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
			this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.SuggestPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUGGEST_PRICE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
			this.Size = Convert.ToDecimal(CommonFunctions.ToObject(dr["SIZE"]));
			this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
			this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.MinorUnit = Convert.ToString(CommonFunctions.ToObject(dr["MINOR_UNIT"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.TypeName = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_NAME"]));
			this.TypeCode = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_CODE"]));
			this.StdName = Convert.ToString(CommonFunctions.ToObject(dr["STD_NAME"]));
			this.StdCode = Convert.ToString(CommonFunctions.ToObject(dr["STD_CODE"]));
			this.RootCodeType = Convert.ToString(CommonFunctions.ToObject(dr["ROOT_CODE_TYPE"]));
			this.StockType = Convert.ToInt32(CommonFunctions.ToObject(dr["STOCK_TYPE"]));
			this.Volume = Convert.ToDecimal(CommonFunctions.ToObject(dr["VOLUME"]));
			this.Uv = Convert.ToString(CommonFunctions.ToObject(dr["UV"]));
			this.Arer = Convert.ToDecimal(CommonFunctions.ToObject(dr["ARER"]));
			this.Ua = Convert.ToString(CommonFunctions.ToObject(dr["UA"]));
			this.BlueprintPath = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_PATH"]));
			this.Photo = (byte[])(CommonFunctions.ToObject(dr["PHOTO"]));
			this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
			this.DeleteFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["DELETE_FLAG"]));
        }
		
		public MstProductEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.ProductTypeId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_TYPE_ID"]));
			this.ProductCode = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_CODE"]));
			this.ProductSpecIn = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_IN"]));
			this.ProductSpecOut = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_SPEC_OUT"]));
			this.ProductName = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_NAME"]));
			this.SuggestPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["SUGGEST_PRICE"]));
			this.Material = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL"]));
			this.Weight = Convert.ToDecimal(CommonFunctions.ToObject(dr["WEIGHT"]));
			this.Size = Convert.ToDecimal(CommonFunctions.ToObject(dr["SIZE"]));
			this.DiameterOut = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_OUT"]));
			this.DiameterIn = Convert.ToDecimal(CommonFunctions.ToObject(dr["DIAMETER_IN"]));
			this.Length = Convert.ToDecimal(CommonFunctions.ToObject(dr["LENGTH"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.MinorUnit = Convert.ToString(CommonFunctions.ToObject(dr["MINOR_UNIT"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.TypeName = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_NAME"]));
			this.TypeCode = Convert.ToString(CommonFunctions.ToObject(dr["TYPE_CODE"]));
			this.StdName = Convert.ToString(CommonFunctions.ToObject(dr["STD_NAME"]));
			this.StdCode = Convert.ToString(CommonFunctions.ToObject(dr["STD_CODE"]));
			this.RootCodeType = Convert.ToString(CommonFunctions.ToObject(dr["ROOT_CODE_TYPE"]));
			this.StockType = Convert.ToInt32(CommonFunctions.ToObject(dr["STOCK_TYPE"]));
			this.Volume = Convert.ToDecimal(CommonFunctions.ToObject(dr["VOLUME"]));
			this.Uv = Convert.ToString(CommonFunctions.ToObject(dr["UV"]));
			this.Arer = Convert.ToDecimal(CommonFunctions.ToObject(dr["ARER"]));
			this.Ua = Convert.ToString(CommonFunctions.ToObject(dr["UA"]));
			this.BlueprintPath = Convert.ToString(CommonFunctions.ToObject(dr["BLUEPRINT_PATH"]));
			this.Photo = (byte[])(CommonFunctions.ToObject(dr["PHOTO"]));
			this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
			this.DeleteFlag = Convert.ToInt32(CommonFunctions.ToObject(dr["DELETE_FLAG"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return MstProductTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_ID)); }
            set { SetData(MstProductTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string ProductTypeId
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_TYPE_ID)); }
            set { SetData(MstProductTable.C_PRODUCT_TYPE_ID, value); }
        }
		
        [DataMember]
        public string ProductCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_CODE)); }
            set { SetData(MstProductTable.C_PRODUCT_CODE, value); }
        }
		
        [DataMember]
        public string ProductSpecIn
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_SPEC_IN)); }
            set { SetData(MstProductTable.C_PRODUCT_SPEC_IN, value); }
        }
		
        [DataMember]
        public string ProductSpecOut
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_SPEC_OUT)); }
            set { SetData(MstProductTable.C_PRODUCT_SPEC_OUT, value); }
        }
		
        [DataMember]
        public string ProductName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_PRODUCT_NAME)); }
            set { SetData(MstProductTable.C_PRODUCT_NAME, value); }
        }
		
        [DataMember]
        public decimal SuggestPrice
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_SUGGEST_PRICE)); }
            set { SetData(MstProductTable.C_SUGGEST_PRICE, value); }
        }
		
        [DataMember]
        public string Material
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MATERIAL)); }
            set { SetData(MstProductTable.C_MATERIAL, value); }
        }
		
        [DataMember]
        public decimal Weight
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_WEIGHT)); }
            set { SetData(MstProductTable.C_WEIGHT, value); }
        }
		
        [DataMember]
        public decimal Size
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_SIZE)); }
            set { SetData(MstProductTable.C_SIZE, value); }
        }
		
        [DataMember]
        public decimal DiameterOut
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_DIAMETER_OUT)); }
            set { SetData(MstProductTable.C_DIAMETER_OUT, value); }
        }
		
        [DataMember]
        public decimal DiameterIn
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_DIAMETER_IN)); }
            set { SetData(MstProductTable.C_DIAMETER_IN, value); }
        }
		
        [DataMember]
        public decimal Length
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_LENGTH)); }
            set { SetData(MstProductTable.C_LENGTH, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(MstProductTable.C_UNIT)); }
            set { SetData(MstProductTable.C_UNIT, value); }
        }
		
        [DataMember]
        public string MinorUnit
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MINOR_UNIT)); }
            set { SetData(MstProductTable.C_MINOR_UNIT, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_MATERIAL_CODE)); }
            set { SetData(MstProductTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public string TypeName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_TYPE_NAME)); }
            set { SetData(MstProductTable.C_TYPE_NAME, value); }
        }
		
        [DataMember]
        public string TypeCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_TYPE_CODE)); }
            set { SetData(MstProductTable.C_TYPE_CODE, value); }
        }
		
        [DataMember]
        public string StdName
        {
            get { return Convert.ToString(GetData(MstProductTable.C_STD_NAME)); }
            set { SetData(MstProductTable.C_STD_NAME, value); }
        }
		
        [DataMember]
        public string StdCode
        {
            get { return Convert.ToString(GetData(MstProductTable.C_STD_CODE)); }
            set { SetData(MstProductTable.C_STD_CODE, value); }
        }
		
        [DataMember]
        public string RootCodeType
        {
            get { return Convert.ToString(GetData(MstProductTable.C_ROOT_CODE_TYPE)); }
            set { SetData(MstProductTable.C_ROOT_CODE_TYPE, value); }
        }
		
        [DataMember]
        public int StockType
        {
            get { return Convert.ToInt32(GetData(MstProductTable.C_STOCK_TYPE)); }
            set { SetData(MstProductTable.C_STOCK_TYPE, value); }
        }
		
        [DataMember]
        public decimal Volume
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_VOLUME)); }
            set { SetData(MstProductTable.C_VOLUME, value); }
        }
		
        [DataMember]
        public string Uv
        {
            get { return Convert.ToString(GetData(MstProductTable.C_UV)); }
            set { SetData(MstProductTable.C_UV, value); }
        }
		
        [DataMember]
        public decimal Arer
        {
            get { return Convert.ToDecimal(GetData(MstProductTable.C_ARER)); }
            set { SetData(MstProductTable.C_ARER, value); }
        }
		
        [DataMember]
        public string Ua
        {
            get { return Convert.ToString(GetData(MstProductTable.C_UA)); }
            set { SetData(MstProductTable.C_UA, value); }
        }
		
        [DataMember]
        public string BlueprintPath
        {
            get { return Convert.ToString(GetData(MstProductTable.C_BLUEPRINT_PATH)); }
            set { SetData(MstProductTable.C_BLUEPRINT_PATH, value); }
        }
		
        [DataMember]
        public byte[] Photo
        {
            get { return (byte[])(GetData(MstProductTable.C_PHOTO)); }
            set { SetData(MstProductTable.C_PHOTO, value); }
        }
		
        [DataMember]
        public string Description
        {
            get { return Convert.ToString(GetData(MstProductTable.C_DESCRIPTION)); }
            set { SetData(MstProductTable.C_DESCRIPTION, value); }
        }
		
        [DataMember]
        public int DeleteFlag
        {
            get { return Convert.ToInt32(GetData(MstProductTable.C_DELETE_FLAG)); }
            set { SetData(MstProductTable.C_DELETE_FLAG, value); }
        }
		
		#endregion
	}
	
	
}	

